﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt.ProjectOpening
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt.ProjectOpening;

    public class ProjectOpenData_Map : EntityMapping<ProjectOpenData>
    {
        public ProjectOpenData_Map()
        {
            Bag(x => x.Details, map =>
            {
                map.Key(km => km.Column("OpenId"));
            }, act => act.OneToMany());

            Property(x => x.OpenDate, map =>
            {
            });

            ManyToOne(x => x.Project, map =>
            {
                map.Column("ProjId");
            });

            Property(x => x.Reader, map =>
            {
                map.Length(40);
            });

            Property(x => x.Recorder, map =>
            {
                map.Length(40);
            }); 
            
            Bag(x => x.Rows, map =>
            {
                map.Key(km => km.Column("OpenId"));
            }, act => act.OneToMany());

            Property(x => x.Title, map =>
            {
                map.Length(200);
            });
        }
    }
}
